package com.example.facecat.product.ui;

import java.util.HashMap;

import facecat.topin.core.*;

public class MyColor {
    public static String m_systemFont = "";

    public static void setSystemFont(String value) {
        m_systemFont = value;
        FCNative.addChangeID();
    }

    public static String getSystemFont() {
        if (m_systemFont.length() == 0) {
            m_systemFont = "System";
        }
        return m_systemFont;
    }

    public int m_lastStyle = -1;

    public static int m_style = 1;

    public HashMap<Long, Long> m_userColors = new HashMap<Long, Long>();

    public static HashMap<Long, Long> m_myColors = new HashMap<Long, Long>();

    public static void setStyle(int value) {
        m_style = value;
    }

    public void createColors() {
        m_userColors.clear();
        if (m_style == 1) {
            m_userColors.put(FCColor.Back, FCColor.rgb(255, 255, 255)); //1
            m_userColors.put(FCColor.Border, FCColor.rgb(200, 200, 200)); //1
            m_userColors.put(FCColor.Text, FCColor.rgb(0, 0, 0)); //1
            m_userColors.put(FCColor.DisabledBack, FCColor.rgba(0, 0, 0, 25)); //1
            m_userColors.put(FCColor.DisabledText, 3289650L);
            m_userColors.put(FCColor.Hovered, FCColor.rgba(43, 138, 195, 150));
            m_userColors.put(FCColor.Pushed, FCColor.rgba(43, 138, 195, 100));
        } else {
            m_userColors.put(FCColor.Back, 1709331L);
            m_userColors.put(FCColor.Border, 3289650L);
            m_userColors.put(FCColor.Text, 16777215L);
            m_userColors.put(FCColor.DisabledBack, -16777215025L);
            m_userColors.put(FCColor.DisabledText, 3289650L);
            m_userColors.put(FCColor.Hovered, -12814891150L);
            m_userColors.put(FCColor.Pushed, -12814891100L);
        }
        m_myColors.clear();
    }

    public long getUserColor(long color) {
        if (m_lastStyle != m_style) {
            m_lastStyle = m_style;
            createColors();
        }
        if (m_myColors.containsKey(color)) {
            color = m_myColors.get(color);
        } else {
            if (m_userColors.containsKey(color)) {
                color = m_userColors.get(color);
            }
        }
        return color;
    }
}